﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BallData
{
    public class MatchItem
    {
        public String mId;
        public String lId;
        public Int32 koTimeUTC;
        public DateTime koTime;
        public String t1Id;
        public String t1CnName;
        public String t1TrName;
        public String t1EnName;
        public String t1Position;
        public String t2Id;
        public String t2CnName;
        public String t2TrName;
        public String t2EnName;
        public String t2Position;
        public String matchTv;
        public String koDay;
        public bool bOver;
        public MatchItem(String infostr)
        {
            var infoArr = infostr.Split(OddsUntil.SplitColumn);
            this.mId = infoArr[0];
            this.lId = infoArr[1];
            this.koTimeUTC = Convert.ToInt32(infoArr[2], 10);
            this.koTime = OddsUntil.ConvertIntDateTime(this.koTimeUTC);
            this.t1Id = infoArr[3];
            this.t1CnName = infoArr[4];
            this.t1TrName = infoArr[5];
            this.t1EnName = infoArr[6];
            this.t1Position = infoArr[7];
            this.t2Id = infoArr[8];
            this.t2CnName = infoArr[9];
            this.t2TrName = infoArr[10];
            this.t2EnName = infoArr[11];
            this.t2Position = infoArr[12];
            this.matchTv = infoArr[13];

            this.koDay = this.koTime.ToString("MM-dd HH:mm");

            this.bOver = false;

        

            
        }
        public String ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("mId:" + mId + "\n");
            sb.Append("lId:" + lId + "\n");
            sb.Append("koTimeUTC:" + koTimeUTC + "\n");
            sb.Append("koTime:" + koTime + "\n");
            sb.Append("t1Id:" + t1Id + "\n");
            sb.Append("t1CnName:" + t1CnName + "\n");
            sb.Append("t1TrName:" + t1TrName + "\n");
            sb.Append("t1EnName:" + t1EnName + "\n");
            sb.Append("t1Position:" + t1Position + "\n");
            sb.Append("t2Id:" + t2Id + "\n");
            sb.Append("t2CnName:" + t2CnName + "\n");
            sb.Append("t2TrName:" + t2TrName + "\n");
            sb.Append("t2EnName:" + t2EnName + "\n");
            sb.Append("t2Position:" + t2Position + "\n");
            sb.Append("matchTv:" + matchTv + "\n");
            sb.Append("koDay:" + koDay + "\n");
            sb.Append("bOver:" + bOver + "\n");
            return sb.ToString();
        }

    }
}
